package com.lorenzogao.customview


import android.os.Bundle
import android.os.Handler
import android.view.View
import com.lorenzogao.customviewexample.R
import com.lorenzogao.lib_view.LetterSideBar
import kotlinx.android.synthetic.main.activity_letter_side_bar.*
import kotlinx.android.synthetic.main.layout_head.*

class LetterSideBarActivity : BaseActivity() {


    private val mHandler = Handler()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_letter_side_bar)
        setToolBar(toolbar, "字母索引列表")


        letter_side.listener = object : LetterSideBar.OnLetterSideBarListener {
            override fun onLetterrSelect(value: String) {
                tvLatter.text = value
                tvLatter.visibility = View.VISIBLE
            }

            override fun onLetterCancel() {
                mHandler.postDelayed({ tvLatter.visibility = View.GONE }, 1000)

            }

        }
    }
}
